import { TaskStatusData } from "../model/TaskModel";
import http from "../utils/Http";

/**
 * 开始运行节点任务
 */
export const startTask = (taskId:string) => {
  return http({
    method: 'post',
    url: '/node/start',
    data: { taskId: taskId}
  })
}

/**
 * 停止节点任务
 */
export const stopTask = (taskId:string) => {
  return http({
    method: 'post',
    url: '/node/stop',
    data: { taskId: taskId}
  })
}

/**
 * 获取节点流程数据
 */
export const getTaskStatus = (taskId:string) => {
  return http<TaskStatusData>({
    method: 'post',
    url: '/node/taskStatus',
    data: { taskId: taskId}
  })
}

/**
 * 获取运行状态
 */
export const getRunStatus = (taskId:string) => {
  return http<boolean>({
    method: 'post',
    url: '/node/runStatus',
    data: { taskId: taskId}
  })
}